{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "05fa5a10-15da-49e9-92cd-a12abbaaae87",
   "metadata": {},
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[WinError 3] 系统找不到指定的路径。: '../item5/item5-ss-data/normal/'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mos\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m normalFileList\u001b[38;5;241m=\u001b[39mos\u001b[38;5;241m.\u001b[39mlistdir(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m../item5/item5-ss-data/normal/\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m      3\u001b[0m spamFileList\u001b[38;5;241m=\u001b[39mos\u001b[38;5;241m.\u001b[39mlistdir(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m../item5/item5-ss-data/spam/\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m      4\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m正常邮件的文件列表\u001b[39m\u001b[38;5;124m\"\u001b[39m,normalFileList)\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [WinError 3] 系统找不到指定的路径。: '../item5/item5-ss-data/normal/'"
     ]
    }
   ],
   "source": [
    "import os\n",
    "normalFileList=os.listdir(\"../item5/item5-ss-data/normal/\")\n",
    "spamFileList=os.listdir(\"../item5/item5-ss-data/spam/\")\n",
    "print(\"正常邮件的文件列表\",normalFileList)\n",
    "print(\"辣鸡邮件的文件列表\",spamFileList)\n",
    "stopList=[]\n",
    "for line in open(\"../item5/item5-ss-data/stopwords.txt/\",encoding='utf-8'):\n",
    "    stopList.append(line[:len(line)-1])\n",
    "    print(\"停用词文件内容:\",stopList)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b6e2e52e-265f-4351-b93c-ee08eaca81b7",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
